## 500 variables, hence 500 univariate regressions are to be fitted
x = matrix( rnorm(100 * 500), ncol = 500 )
## 100 observations in total
y = rbinom(100, 1, 0.6) ## binary logistic regression
system.time( logistic_only(x, y) )
a1 = logistic_only(x, y)
a2 <- numeric(500)
system.time( for (i in 1:500) a2[i] = glm(y ~ x[, i], binomial)$deviance )
Run the code above in your browser using DataLab